package com.lxl.workbench.service;

import com.lxl.settings.entity.User;
import com.lxl.workbench.entity.Curator;
import com.lxl.workbench.entity.Library;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 北上寻海
 */
public interface LibraryService {

    /**
     * 添加图书馆
     * @param user 用户
     * @param curator 馆长
     * @param library 图书馆
     * @throws SQLException sql
     */
    void insertLibraryByCondition(User user, Curator curator,Library library) throws SQLException;
    /**
     * 更新图书馆信息
     * @param library 待更新的图书馆的信息
     * @throws SQLException SQL异常
     */
    void updateLibraryByCondition(Library library,Curator curator,User user) throws SQLException;

    /**
     * 通过id删除图书馆，批量删除
     * @param delIds 待删除的图书馆的id数组
     * @return int
     * @throws SQLException SQL异常
     */
    int deleteLibraryByIds(String[] delIds) throws SQLException;

    /**
     * 查询图书馆，根据条件筛选
     * @param libraryName 图书馆的名称
     * @param libraryLocation 图书馆的位置
     * @return 查询结果集，图书馆的List集合
     * @throws SQLException SQL异常
     */
    List<Library> queryLibraryByCondition(String libraryName,String libraryLocation) throws SQLException;

    /**
     * 通过id查图书馆
     * @param id 待查图书馆的id
     * @return 图书馆的集合
     * @throws SQLException SQL异常
     */
    List<Library> queryLibraryById(String id) throws SQLException;

    List<Library> selectLibraryByIds(String [] ids) throws SQLException;

    void deleteLibraryConditionByIds(String [] libraryIds,String [] curatorIds,String [] userIds) throws SQLException;

}
